﻿<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Pzgl_PzRule.aspx.vb" Inherits="PubProject.Pzgl_PzRule"%>
<%@ Register TagPrefix="cc1" Namespace="Mysoft.PubProject.Business" Assembly="Mysoft.PubProject.Business" %>
<%@ Register TagPrefix="mnu" Namespace="Mysoft.Map.Application.Menus" Assembly="Mysoft.Map.Application.Components" %>
<%@ Register TagPrefix="cnt" Namespace="Mysoft.Map.Application.Controls" Assembly="Mysoft.Map.Application.Components" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title></title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<LINK href="/_grid/map_grid.css" type="text/css" rel="stylesheet">
	    <script language="javascript" src="/_controls/settings.aspx"></script>
		<link rel="stylesheet" type="text/css" href="/_nav/tabs.css">
		<link rel="stylesheet" type="text/css" href="/_grid/map_grid.css">
		<link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
		<link rel="stylesheet" type="text/css" href="/_nav/taskbox.css">
		<link rel="stylesheet" type="text/css" href="/_nav/menu.css">
		<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css">
		<link rel="stylesheet" type="text/css" href="/_controls/find/find.css">
		<script language="javascript" src="/_common/scripts/global.js"></script>
		<script language="javascript" src="/_controls/find/find.js"></script>
		<script language="javascript" src="/_controls/util/util.js"></script>
		<script language="javascript" src="/_controls/datetime/date.js"></script>
		<script language="javascript" src="/_controls/number/number.js"></script>
		<!-- GridTree -->
		<link rel="stylesheet" type="text/css" href="/_controls/tree/gridtree.css">
		
		<script type="text/javascript">
		//在线帮助文件
		var _MyHelpfile = "/Cbgl/Help/topics/财务人员/设置财务接口/设置凭证规则.html";
		var strOldHierarchyCode= "";
		var isBussionType="";
			function window.onload ()
			{
			    if (document.all["__Application"] && document.all["__Application"].value == "0101") {
			        _MyHelpfile = "/Slxt/Help/topics/财务管理/财务接口设置/设置凭证规则.html";
			    }
                appGridTree.showLevel(2);
                appGridTree.selectedIndex=1 ;
                appGridTree.selectByLevel(document.all.txtLocation.value);
            }
			
			function openPzRuleSet(obj)
			{
				var sHierarchyCode = "";
				
				var arrTr = appGridTree.selectedRow;
				
				if (arrTr){
					sHierarchyCode = arrTr.HierarchyCode;
				}
				
				//如通过按钮点击，则需要额外处理
				if(obj =="btn") isBussionType="";
				
				//是否选择的业务分类
				if (isBussionType !="") return;
			   
				if (!(document.all("__CwztGUID")&&document.all("__CwztGUID").value!= ""&&document.all("__CwztGUID").value!="00000000-0000-0000-0000-000000000000"))
			    {
				    alert("请选择财务账套！");
				    return;
			    }
				
				var sCwztGUID = document.all("__CwztGUID").value;
				var sApplication = document.all("__Application").value;
				var rdNum = Math.random();
				var sParamList = "?CwztGUID=" + escape(sCwztGUID);
				sParamList += "&Application=" + escape(sApplication);
				sParamList += "&HierarchyCode=" + sHierarchyCode;
				sParamList += "&rdnum=" + rdNum;
				var sPath = "/PubProject/Cwjk/Cwjk_PzRuleSet.aspx";
				openMyFullWin(sPath + sParamList,"");
			}
			
			function trClick(obj)
			{
				//不能选择业务分类
				var arrTr = appGridTree.selectedRow;
				if (arrTr)
				{
					if (strOldHierarchyCode == arrTr.HierarchyCode) 
					{
						return;
					}
				}
				//如果选择的是业务分类，那么将选中之前的那条记录
	            if (arrTr.HierarchyCode.split(".").length == "1")
	            {
	                appGridTree.selectByLevel(strOldHierarchyCode);
	                isBussionType = "true";
	            }
	            else
	            {
	                strOldHierarchyCode = arrTr.HierarchyCode;
	                isBussionType = "";
	            }
			}
			//刷新页面
            function RefreshWindow()
            {
	            oTr = appGridTree.selectedRow;
	            if (!oTr) 
	            {
		            document.all.txtLocation.value = "";
	            }
	            else
	            {
		            document.all.txtLocation.value = oTr.HierarchyCode;
	            }
            	
	            __doPostBack("","");
            }
	           
		</script>
	</HEAD>
	<body MS_POSITIONING="GridLayout" style="PADDING-RIGHT:0px;PADDING-LEFT:0px;PADDING-BOTTOM:0px;PADDING-TOP:0px">
	<form id="Form1" runat="server">
	<asp:textbox id="txtLocation" style="DISPLAY: none" Runat="server"></asp:textbox>
	<asp:linkbutton id="LinkButton1" runat="server"></asp:linkbutton>	
		<table style="FONT-SIZE: 9pt" height="100%" cellSpacing="0" cellPadding="0" width="100%">
			<tr  height="100%" >
				<td>
					<table style="FONT-SIZE: 9pt" height="100%" cellSpacing="0" cellPadding="0" width="100%">
						<tr height="1">
							<td>
								<mnu:AppGridMenu id="appGridMenu" runat="server" />
							</td>
						</tr>
						<tr>
							<td>
								<cnt:AppGridTree id="appGridTree" runat="server"  filter="<filter />" />
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</form>		
	</body>
</HTML>